<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // Array.prototype.fill   填充
        let arr = [1,2,3,4,5]
        arr.fill(7);
        console.log(arr);

        // 长度7
        let arr1 = new Array(7);
        // 填充为7
        arr1.fill(7);
        console.log(arr1);

        // 第二个参数 填充的索引 第三个参数  填充结束的索引
        let arr2 = [1,2,3,4,5];
        arr2.fill("hello",2,4);
        console.log(arr2);

    </script>
</body>
</html>